home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
8_9.lha
/
8_9
/
8_9tst.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
1KB
|
45 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <stream.h>
include <ctype.h>
include "8_9a1.h" /* class eFILE */
include "8_9a2.c" /* eFILE *efopen(char*) */
include "8_9a3.c" /* efclose(eFILE*) */
include "8_9a4.c" /* int egetc(eFILE*, long) */
include "8_9a5.c" /* int eputc(eFILE*, long, int) */
include "8_9b1.h" /* class randomloc */
include "8_9b2.c" /* randomloc::randomloc */
include "8_9b3.c" /* randomloc::operator int() */
include "8_9b4.c" /* randomloc operator=(randomloc, int) */
include "8_9b5.c" /* randomloc operator=(randomloc, randomloc) */
include "8_9c1.h" /* class random */
include "8_9c2.c" /* random::random() */
include "8_9c3.c" /* random::~random() */
include "8_9c4.c" /* int random::openedokay() */
include "8_9c5.c" /* randomloc random::operator[]() */
nt main(int, char**)
random x("tst.data");
int i = x[3];
cout << "x[3] = " << i;
if (isprint(i)) cout << ", " << chr(i);
cout << "\n";
if ((int)x[2])
cout << "if x[2] passed\n";
else
cout << "if x[2] failed\n";
x[1] = '3';
cout << "assigned x[1] <- '3'\n";
x[0] = x[9];
cout << "assigned x[0] <- x[8]\n";
return 0;